package jindong;

import java.util.Arrays;
import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        scanner.nextLine();
        while (t-- != 0) {
            int a = 0, b = 0;//a==o,b==*
            char[][] chars = new char[3][3];
            for (int i = 0; i < 3; ++i) {
                String str = scanner.nextLine();
                chars[i] = str.toCharArray();
            }
            for (int i = 0; i < 3; ++i) {
                for (int j = 0; j < 3; ++j) {
                    if (chars[i][j] == '.') {
                        continue;
                    }
                    if ((checkH(j) && chars[i][j - 1] == chars[i][j + 1] && chars[i][j + 1] == '*' && chars[i][j] == 'o') ||
                            (checkV(i) && chars[i - 1][j] == chars[i + 1][j] && chars[i + 1][j] == '*' && chars[i][j] == 'o')) {
                        a++;
                    } else if ((checkH(j) && chars[i][j - 1] == chars[i][j + 1] && chars[i][j + 1] == 'o' && chars[i][j] == '*') ||
                            (checkV(i) && chars[i - 1][j] == chars[i + 1][j] && chars[i + 1][j] == 'o' && chars[i][j] == '*')) {
                        b++;
                    }
                }
            }
            if (a == 0 && a < b) {
                System.out.println("yukari");
            } else if (b == 0 && a > b) {
                System.out.println("kou");
            }else{
                System.out.println("draw");
            }
        }
    }

    private static boolean checkV(int i) {
        if (i - 1 >= 0 && i + 1 < 3) {
            return true;
        }
        return false;
    }

    private static boolean checkH(int j) {
        if (j - 1 >= 0 && j + 1 < 3) {
            return true;
        }
        return false;
    }
}
